import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//5.1修改elementPlus默认中文
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

const BASE_URL = "http://localhost:8080"
window.BASE_URL=BASE_URL



//引入elementplus组件库
import ElementPlus, {ElMessage} from 'element-plus'
import 'element-plus/dist/index.css'


// main.ts

// 引入element-plus图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import axios from "axios";

//遍历ElementPlusIconsVue对象中所有的图标组件并注册到vue实例app中
const app = createApp(App)
app.config.globalProperties.BASE_URL=BASE_URL

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

//use(ElementPlus)  给当前vue实例使用elementplus组件库
app.use(ElementPlus,{ locale: zhCn }).use(store).use(router).mount('#app')

